From: Niklas Laxström Date: Sun, 9 Jan 2011 12:46:40 +0000 (+0000) Subject: * (bug 25506) Exception is thrown if OutputPage::parse is called inside a tag hook... X-Git-Tag: 1.31.0-rc.0~32670 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=eba61fa15909f61cc67b273815f6e9325cb1a9bc;p=lhc%2Fweb%2Fwiklou.git * (bug 25506) Exception is thrown if OutputPage::parse is called inside a tag hook, which would reset parser state --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b4ae6c2b4d..2595c3b8bb 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -68,6 +68,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * If an edit summary exceeds 250 bytes and is truncated, add an ellipse * (bug 26638) Database error pages display correctly in RTL languages * (bug 26187) Confirmrecreate no longer parses the edit summary +* (bug 25506) Exception is thrown if OutputPage::parse is called inside a tag hook, + which would reset parser state === API changes in 1.18 === * (bug 26339) Throw warning when truncating an overlarge API result diff --git a/includes/OutputPage.php b/includes/OutputPage.php index fd527d257d..81eefa582e 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1187,6 +1187,13 @@ class OutputPage { * @return String: HTML */ public function parse( $text, $linestart = true, $interface = false, $language = null ) { + // Check one for one common cause for parser state resetting + $callers = wfGetAllCallers( 10 ); + if ( strpos( $callers, 'Parser::extensionSubstitution' ) !== false ) { + throw new MWException( "wfMsg* function with parsing cannot be used " . + "inside a tag hook. Should use parser->recursiveTagParse() instead" ); + } + global $wgParser; if( is_null( $this->getTitle() ) ) {